package top.likeqc.dto;

import lombok.Data;
import top.likeqc.entity.CourseStudent;

import java.util.ArrayList;
import java.util.List;

/**
 * @author likeqc
 * @date 2022年04月15日 15:11
 */
@Data
public class CourseStudentDTO {
    private Long courseId;

    private List<Long> number;

    public List<CourseStudent> getCourseStudentList() {
        List<CourseStudent> courseStudentList = new ArrayList<>();
        number.forEach(num -> {
            CourseStudent courseStudent = new CourseStudent();
            courseStudent.setCourseId(courseId);
            courseStudent.setStudentId(num);
            courseStudentList.add(courseStudent);
        });

        return courseStudentList;
    }
}
